package org.wicketstuff.viewstack.model;

import org.wicketstuff.viewstack.view.IView;
/**
 * 
 * @author fernando wermus
 *
 */
public class WizardModel extends ViewStackModel implements IWizardModel{
	private static final long serialVersionUID = -2997419897962817291L;

	public boolean hasNext() {
		return getActiveViewIndex() + 1 < size();
	}


	public boolean hasPrevious() {
		return 0 < getActiveViewIndex();
	}

	public IView next() {
		setActiveView(getView(getActiveViewIndex() + 1));
		return getActiveView();
	}

	public IView previous() {
		setActiveView(getView(getActiveViewIndex()  - 1));
		return getActiveView();
	}


	public boolean isFinish() {
		return !hasNext();
	}

}
